import React from 'react'
import moment from 'moment';
import { Link, Control } from 'react-keeper'
import 'weui';
import fangzi from './../../assets/icon/房子.png';
import { Button,Page, Panel,PanelHeader, PanelBody, PanelFooter,ButtonArea, MediaBox,Cells,
  Cell,CellHeader,MediaBoxTitle,MediaBoxHeader,MediaBoxDescription,MediaBoxBody,MediaBoxInfo,Article,
  MediaBoxInfoMeta,Input,CellsTips,Icon,Label,CellsTitle,Toptips,InfiniteLoader,Popup,PopupHeader,Grids,
  Tab,Footer,FooterLinks,FooterLink,FooterText,Flex,FlexItem,CellFooter,CellBody,FormCell,PreviewButton
} from  'react-weui/build/packages';
import inputtp from './../../assets/icon/输入.png';
import aqtp from './../../assets/icon/安全日志S.png';

export default class SbInfo extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
    }
    this.goAdd = this.goAdd.bind(this);
    this.goList= this.goList.bind(this);
  }

  goAdd() {
    Control.go(this.props.jlls.router);
  }


  goList() {
    Control.go(this.props.jlls.router+'list',this.props.jlls.seng);
  }

  shouldComponentUpdate(nextProps = {}, nextState = {}) {
    return true;
  }

  render() {
    return (
            <div>
              <Panel className="head-panel">
                <PanelHeader>
                  <div className="title-bg"/>
                  {this.props.jlls.text}
                </PanelHeader>
                <PanelBody>
                  <FormCell>
                    <CellBody>
                      <p style={{fontSize: '13px'}}>{this.props.jlls.seng.engName}  </p>
                      <p style={{fontSize: '13px', color: '#888888'}}>
                        {moment(this.props.jlls.jlrq).format('YYYY-MM-DD')}
                        </p>
                   </CellBody>
                   <CellFooter>
                      <img src={this.props.jlls.icon} alt="" o style={{display: `block`, width: `20px`, marginRight: `5px`}}/>
                   </CellFooter>
                  </FormCell>
                  <FormCell>
                    <CellBody access link onClick={this.goAdd}>
                      <div style={{textAlign:'left',fontSize:'14',color:'#586C94',displsy:'-webkit-box',fontFamily:'monospace'}}>
                        新增记录
                      </div>

                    </CellBody>
                    <CellFooter access link onClick={this.goList}>
                      <div style={{textAlign:'center',fontSize:'14',color:'#586C94',displsy:'-webkit-box',fontFamily:'monospace'}}>

                        查看更多
                      </div>
                    </CellFooter>
                  </FormCell>
                </PanelBody>
              </Panel>
              <Footer>
                <FooterText>&nbsp;</FooterText>
              </Footer>
            </div>

    )
  }
}

SbInfo.propTypes = {
  jlls: React.PropTypes.object.isRequired,
  eng: React.PropTypes.object.isRequired,
}



